<template>
    <div class="content">
		<div class="header">
			<div class="left" @click="goList('1')">
				<div>{{listObj.one_num || '0'}}<span>人</span></div>
				<div class="small">
					一级客户
				</div>
			</div>
			<div class="left" @click="goList('2')">
				<div>{{listObj.two_num || '0'}}<span>人</span></div>
				<div class="small">
					二级客户
				</div>
			</div>
		</div>
		<div class="container">
			<div class="top">
				<span>消费时间</span>
				<span>获取奖励</span>
			</div>
			<div class="item" v-for="(item,index) in arr" :key="index">
				<div class="left">
					<div class="top">{{item.type}}</div>
					<div class="time">{{item.createtime}}</div>
				</div>
				<div class="right">+{{item.money}}</div>
			</div>
		</div>
	</div>
</template>
<script>
export default {
    data(){
        return{
            userinfo: {},
			showList:[],
			page: 1,
			last_page:1,
			obj:{},
			listObj:{},
			arr:[]
        }
	},
	mounted() {
		this.loadList();
		this.loadMoney()
	},
    methods:{
		loadList(){
			this.$http.post('/api/rate/rate_member').then(res => {
				// console.log(res)
				this.listObj = res.data;
			})
		},
        goList(type){
            this.$router.push({path:'/list',query:{type}})
		},
		loadMoney(){
			this.$http.post('/api/rate/money_log',{page:1,limit:10000}).then(res => {
				// console.log(res)
				this.arr = res.data.data;
			})
		}
    }
}
</script>
<style lang="scss" scoped="scoped">
    .header{
		width: 100%;
		height: 53.33vw;
		background:rgba(231,188,134,1);
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0 19.466vw;
		box-sizing: border-box;
		div{
			font-size:36px;
			font-family:PingFang SC;
			font-weight:bold;
			color:rgba(255,255,255,1);
			span{
				font-size: 15px;
			}
		}
		.small{
			font-size:14px;
			font-family:PingFang SC;
			font-weight:500;
			color:rgba(255,255,255,.7);
		}
	}
	.container{
		width: 100%;
		padding: 3vw 4vw 0;
		box-sizing: border-box;
		.top{
			display: flex;
			justify-content: space-between;
			align-items: center;
            // margin-bottom: 20px;
			span{
				font-size:15px;
				font-family:PingFang SC;
				font-weight:bold;
				color:rgba(51,51,51,1);
			}
		}
		.item{
			height: 17.1vw;
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-bottom: 1px solid #EDEDED;
			.left{
				.top{
					font-size:14px;
					font-family:PingFang SC;
					font-weight:500;
					color:rgba(51,51,51,1);
                    margin-bottom: 0px;
				}
				.time{
					margin-top: 0.525rem;
					font-size:12px;
					font-family:PingFang SC;
					font-weight:500;
					color:rgba(153,153,153,1);
				}
			}
			.right{
				font-size:15px;
				font-family:PingFang SC;
				font-weight:500;
				color:rgba(231,188,134,1);
			}
		}
	}
</style>